package com.ropeok.service.impl;
import com.ropeok.dao.UserDao;
import com.ropeok.entity.User;
import com.ropeok.service.UserService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import java.util.List;
/**
 * @BelongsProject: task2
 * @BelongsPackage: com.ropeok.service
 * @Author: zhoufeifan
 * @CreateTime: 2022-08-23  14:24
 * @Description: TODO
 * @Version: 1.0
 */
@Service
public class UserServiceImpl implements UserService {
    @Autowired
    private UserDao userDao;
    @Override
    public User findById(long id) {
        User user =  userDao.getUserById(id);
        return user;
    }

    @Override
    public List<User> getUserList() {
        List<User> userList = userDao.getUserList();
        return userList;

    }
    @Override
    public void addUser(User user) {
        userDao.addUser(user);
    }

    @Override
    public void deleteUser(Integer id) {
        userDao.deleteUser(id);
    }

    @Override
    public void updateUser(User user) {
        userDao.updateUser(user);
    }
}
